Skip to content

[nrf fromlist] GRTC optimizations #2740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3,096 commits into
base: main
Choose a base branch
from

Conversation

nordic-krch
Copy link
Contributor

Changes in GRTC system clock driver that reduce time spend in GRTC calls by approx. 50%.

PR created to run NCS CI on that change.

krish2718 and others added 30 commits April 3, 2025 12:33
Pull in support for building OSAL code as a standalone library.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit d1ebd66)
Move the cmake file of OSAL to it's own repo and build as a standalone
library, this is porting friendly.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit f74ff15)
These are duplicates of nRF7o bus library.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit f8b3320)
Add appropriate tags for these to be run in CI.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 1d5447d)
Update the `nrf_wifi` repository so that git ignores binary blobs
fetched by `west blobs fetch nrf_wifi`.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit 1b0fe8f)
Pull fix to add NULL checks to avoid crashes.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 8444e26)
Update the driver to use the updated mode specific
data structure names.

Signed-off-by: Sachin D Kulkarni <[email protected]>
(cherry picked from commit 922d207)
`NRF70_SYSTEM_WITH_RAW_MODES` is more accurately described as an
additional option on top of `NRF70_SYSTEM_MODE`, not as a unique
choice of `NRF70_OPER_MODES`.

This allows the elimination of multiple `NRF70_SYSTEM_MODE ||
NRF70_SYSTEM_WITH_RAW_MODES` dependencies.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit d95de82)
This symbol now has the same meaning as `NRF70_SYSTEM_MODE`.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit 2e711aa)
Update the nrf70 Wi-Fi driver to use the mode specific
APIs (as a precursor to enable combining modes as required).

Signed-off-by: Sachin D Kulkarni <[email protected]>
(cherry picked from commit a6dfdb9)
Add test cases for SoftAP and P2P modes.

Signed-off-by: Sachin D Kulkarni <[email protected]>
(cherry picked from commit 522387e)
…ode.

Fix compilation issues for SoftAP mode which were missed in the mode
specific code changes.

Signed-off-by: Sachin D Kulkarni <[email protected]>
(cherry picked from commit 5f69ab7)
Pull in the latest fixes for the SAP and P2P mode builds.

Signed-off-by: Sachin D Kulkarni <[email protected]>
(cherry picked from commit d2e0bb2)
Add wifi_spi label to nRF54h and nRF54l dts files to help
in shield overlay files

Signed-off-by: Bansidhar P.M <[email protected]>
(cherry picked from commit eb93df2)
Create dedicated memory pools for Wi-Fi management and
data operations (defaults: 20KB for management and 130KB for data).
Setting Data pool to 110KB for non-Nordic SOCs to resolve
RAM overflows seen in twister runs.

Remove the `HEAP_MEM_POOL_ADD_SIZE_NRF70` hint since we are
creating separate heaps for driver and not allocating from
system heap.

Signed-off-by: Ravi Dondaputi <[email protected]>
(cherry picked from commit aa0cb68)
…ry pools

Pull changes for creating separate memory pools for control traffic
and data traffic.

Signed-off-by: Ravi Dondaputi <[email protected]>
(cherry picked from commit 7f775c3)
With introduction of OSAL wrapper for memory allocation, usage of
zephyr's native malloc calls need to be removed. When NRF70 driver
is not enabled, OSAL needs to be built explicitly.

Signed-off-by: Ravi Dondaputi <[email protected]>
(cherry picked from commit 208e686)
Some file names are changed, fix file names in
doxygen comments.

Signed-off-by: Kapil Bhatt <[email protected]>
(cherry picked from commit 46829bb)
With recent code restructuring file name and path
has been changed in nrf_wifi lib.

Signed-off-by: Kapil Bhatt <[email protected]>
(cherry picked from commit 9285344)
… info

Pull in change to include reg chan info along with reg domain in the
GET_REG_DOMAIN event for the radio test and offloaded raw TX modes.

Signed-off-by: Sachin D Kulkarni <[email protected]>
(cherry picked from commit a34198b)
Pull in fix for CI failure in Offloaded raw TX mode caused
due to commit 0cd3bb2291a7dd22f4cdb1a4cd935a213c2bbfab in nrf_wifi

Signed-off-by: Sachin D Kulkarni <[email protected]>
(cherry picked from commit 69ce6af)
Add prompt to Kconfig NRF70_SYSTEM_WITH_RAW_MODES.
It is assigned in a configuration file, but is not directly
user-configurable (has no prompt). It gets its value
indirectly from other symbols.

Signed-off-by: Kapil Bhatt <[email protected]>
(cherry picked from commit 3ef187d)
…ents

Fix doxygen comments of arguments.

Signed-off-by: Kapil Bhatt <[email protected]>
(cherry picked from commit 5f3bd5d)
nRF70 driver now uses a separate heap, so, no need to explicitly
configure the kernel heap.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 0b8601c)
nRF70 now by default uses variale buffers.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 8fe1df6)
Fine-tune the heap to get peak UDP (TX and RX) results but with minimal
heap consumption.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit be4c79b)
This uses the network packet as is without the need for a copy all the
way till the packet is handed over to RPU.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 5119f9c)
Now that nRF70 by default uses zero-copy fine-tune the configuration to
get optimal memory while getting peak throughputs.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit e33d9ee)
… address packets

The RFC1122 section 3.3.6 says we SHOULD drop the packets if L2 address
is brodcast but L3 address is unicast, but we had seen some Wi-Fi access
points in the field not conforming to that, and DHCP offer is dropped
due to this and causes Wi-Fi connectivity issues.

As the RFC saus it's SHOULD and not a MUST, add a config option to allow
such packets, disabled by default.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 4cd6654)
Add new Ethernet driver config option,
ETHERNET_CONFIG_TYPE_EXTRA_TX_PKT_HEADROOM, which allows Ethernet
drivers to inform L2 about the extra net_pkt headroom they need to be
allocated.
This is only supported when CONFIG_NET_L2_ETHERNET_RESERVE_HEADER is
enabled, so that it's possible to fit entire packet into a single
net_buf, which is needed for zero-copy transmission.

Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit 78c3996)
nordic-krch and others added 15 commits May 5, 2025 09:43
Add calls to sys_trace_idle and sys_trace_idle_exit in nrf54h specific
idle states to allow measuring CPU load on nrf54h20 when power
management is enabled.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 37fe750)
…rd variant

The required jlink script was not added due to missing entry in the
board check. Also change the check for app vs rad to be on SOC level.

Signed-off-by: Håkon Amundsen <[email protected]>
(cherry picked from commit 4edc003)
This is needed for next generation Secure Domain firmware.

Upstream PR #: 88908

Signed-off-by: Sebastian Bøe <[email protected]>
Protection circuit must be disabled to use NFCT antenna pins
as GPIOs. It can be done by adding nfct-pins-as-gpios to nfct
node in the devicetree in cpuapp. Node must be disabled as
NFCT is not used. In legacy platforms same property was added
to uicr node because that information was stored in UICR. In
nrf54h20 it is not part of UICR so property is part of nfct
node.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 7249fac)
Port SYS_INIT to use soc_early_init_hook as SYS_INITs are legacy.

Upstream PR #: 88908

Signed-off-by: Sebastian Bøe <[email protected]>
…service

Add an IPC service API for booting local domain cores.

Upstream PR #: 88908

Signed-off-by: Sebastian Bøe <[email protected]>
…nit_hook

Boot the radiocore from the app in soc_late_init_hook.

Upstream PR #: 88908

Signed-off-by: Sebastian Bøe <[email protected]>
…/cpuapp/iron

Add support for nrf54h20dk/nrf54h20/cpuapp/iron to the
samples/sysbuild/hello_world sample.

Upstream PR #: 88908

Signed-off-by: Sebastian Bøe <[email protected]>
… test

nrf54h should be capable of operating
the CAN interface when GPD is enabled.

Signed-off-by: Bartosz Miller <[email protected]>
(cherry picked from commit a1a8d28)
…RF_IRONSIDE

Add a promptless symbol that can be selected by different drivers. It is
there to ensure that the corresponding library is not added to the build
unless it contains at least one source file.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit 3353bbc0661e66ff78479c04c99420bff12eede6)
Events used in `call.c` should've been defined as static.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit 52f834068a076f6b3d675fe1dbf11401f03cf081)
Applied as noup because of conflicts.

Upstream PR #: 89333

Add an IPC service API for triggering updates of the Nordic IRONside SE
firmware using the IRONside call module.

Co-authored-by: Håkon Amundsen <[email protected]>
Signed-off-by: Jonathan Nilsen <[email protected]>
Upstream PR #: 89333

Enable the cpusec_bellboard by default for the cpuapp iron board variant
so that IPC toward the secure domain is available by default. Because
IPC is needed to boot the radio core, this fits the standard use case.

Signed-off-by: Jonathan Nilsen <[email protected]>
…e update service

Upstream PR #: 89333

Add a sample demonstrating how to use the IRONside update service to
update the IRONside SE firmware on the nrf54h20dk/nrf54h20/cpuapp/iron
board.

Co-authored-by: Håkon Amundsen <[email protected]>
Signed-off-by: Jonathan Nilsen <[email protected]>
…o 26

The tx-en-settle-time-us is set to 26 to take into account
the time needed for the RF output power rise time of the nRF5 SoC.

Upstream PR #: 89465

Signed-off-by: Andrzej Kuros <[email protected]>
@nordic-krch nordic-krch force-pushed the ncs/grtc_optimization branch 2 times, most recently from 51a64be to 25d225b Compare May 6, 2025 07:14
nordic-krch and others added 3 commits May 8, 2025 09:09
…XTO during restart

Some SoCs generates unexpected RXTO event during restart.
Restart happens when ENDRX_STARTRX short is enabled and STOPRX
is triggered (via short or by CPU). STOPRX starts closing
procedure and ENDRX event is generated at some point which
triggers STARTRX and closing procedure is interrupted. RXTO
should not be triggered in that case. Due to internal timings
some SoC on fast UARTE instance will trigger RXTO followed
by RXSTARTED. This RXTO event shall be cleared as receiver is
actually restarted and not stopped.

Affected SoC is not in tree so Kconfig is added which enables
the workaround.

Upstream PR #: 88935

Signed-off-by: Krzysztof Chruściński <[email protected]>
So that we have access to the new nrf_gpio_pin_drive_get() API.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit becf5ed)
…nect#292

Pull in zephyrproject-rtos/hal_nordic#292.

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit c5033a2a53dedb69478c0aff45d9e600b0de209c)
@nordic-krch nordic-krch force-pushed the ncs/grtc_optimization branch 6 times, most recently from 624b375 to 0a523b9 Compare May 13, 2025 15:12
…ister access

Speed up execution of the interrupt handler and sys_clock_set_timeout().
Sys_clock_set_timeout() can be called in two scenarios: from previous
timeout expiration handler or freely. If the former case fast path
can be used since CC value in the GRTC register just expired and it
can be used as a reference for CCADD setting. This is only a single
register write so it's much faster. In the latter a longer procedure
is applied which also happens in two variants. If value which is
set in CC is further in the future (e.g. K_FOREVER was set before) then
CC can be safely overwritten with a new value without a risk of
triggering unexpected COMPARE event. If value in CC is earlier than
the new CC value (if earlier timeout was aborted) then there is a
risk of COMPARE event happening while it is being overwritten.
That case requires long and safer procedure of setting CC.

Update hal_nordic with changes in the nrfx_grtc driver which are
needed for nrf_grtc_timer changes.

Upstream PR #: 87944

Signed-off-by: Krzysztof Chruściński <[email protected]>
@nordic-krch nordic-krch force-pushed the ncs/grtc_optimization branch from 0a523b9 to a9d803b Compare May 14, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.